﻿using Microsoft.AspNetCore.Mvc.Filters;
using Microsoft.Extensions.DependencyInjection;

namespace CommonUtils
{
    public class FilterOfOrdered : IOrderedFilter
    {
        public int Order
        {
            get
            {
                (ReflectionUtil.GetSenderClassName() + "." + ReflectionUtil.GetSenderMethodName()
                    + " FilterOfOrdered").Print();
                return 0;
            }
        }
        public static void AddTo(IServiceCollection services)
        {
            services.AddMvc(options => options.Filters.Add<FilterOfOrdered>());
        }
    }
}
